﻿using MediatR;
using Process.DAL;

namespace Process.Api.Application.Command.BOM
{
    public class CreateBomCommand:IRequest<ApiResult<int>>
    {
        /// <summary>
        /// BOM编号
        /// </summary>
        public string BOMCode { get; set; }
        /// <summary>
        /// BOM名称
        /// </summary>
        public string BOMTitle { get; set; }
        /// <summary>
        /// 关联产品（物品）ID，可选
        /// </summary>
        public int? ProductGoodsId { get; set; }
        /// <summary>
        /// 产品编号（冗余展示）
        /// </summary>
        public string ProductsCode { get; set; }
        /// <summary>
        /// 产品名称（冗余展示）
        /// </summary>
        public string ProductsName { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string ProductsModel { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string ProductsUnit { get; set; }
        /// <summary>
        /// 品牌
        /// </summary>
        public string Brand { get; set; }
        /// <summary>
        /// 是否默认版本
        /// </summary>
        public bool Status { get; set; }
        /// <summary>
        /// 版本号
        /// </summary>
        public string Version { get; set; }
        /// <summary>
        /// 日产量
        /// </summary>
        public int Output { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Desc { get; set; }

        /// <summary>
        /// 配件列表 - 一对多关系
        /// </summary>
        public List<BomGoodsRelationDto> GoodsRelations { get; set; } = new List<BomGoodsRelationDto>();

        /// <summary>
        /// 工艺流程列表 - 一对多关系
        /// </summary>
        public List<BomFlowRelationDto> FlowRelations { get; set; } = new List<BomFlowRelationDto>();
    }

    /// <summary>
    /// BOM配件关系DTO
    /// </summary>
    public class BomGoodsRelationDto
    {
        /// <summary>
        /// 物品ID
        /// </summary>
        public int GoodsinfoId { get; set; }
    }

    /// <summary>
    /// BOM工艺流程关系DTO
    /// </summary>
    public class BomFlowRelationDto
    {
        /// <summary>
        /// 工艺流程ID
        /// </summary>
        public int ProcessFlowId { get; set; }
    }
}
